import Layout from "@/layout/Layout.vue";
import {createRouter, createWebHistory} from "vue-router";

export const LocalRouteChildren = [
    {
        path: '/gis/map',
        name: 'GisMap',
        component: () => import('@/view/gis/map/index.vue'),
        meta: {title: '地图初始化配置'},
    },
    {
        path: '/gis/point',
        name: 'GisPoint',
        component: () => import('@/view/gis/point/index.vue'),
        meta: {title: '标注点管理'},
    },
    {
        path: '/gis/layer',
        name: 'GisLayer',
        component: () => import('@/view/gis/layer/index.vue'),
        meta: {title: '图层管理'},
    },
    {
        path: '/gis/dem',
        name: 'GisDem',
        component: () => import('@/view/gis/dem/index.vue'),
        meta: {title: 'DEM数据管理'},
    },
    {
        path: '/gis/menu',
        name: 'GisMenu',
        component: () => import('@/view/gis/menu/index.vue'),
        meta: {title: '数据配置'},
    },
]

export const LocalRoute = [
    {
        path: '/',
        name: 'layout',
        component: Layout,
        redirect: '/gis/map',
        meta: {title: '地图信息配置'},
        children: LocalRouteChildren
    },
];

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: LocalRoute
})

export default router
